<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActiveSupport::Cache::FileStore</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            ActiveSupport::Cache::FileStore 
            
                <span class="parent">&lt; 
                    
                    <a href="Store.html">ActiveSupport::Cache::Store</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../files/activesupport/lib/active_support/cache/file_store_rb.html">activesupport/lib/active_support/cache/file_store.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  
    <div class="description">
      
<p>A cache store implementation which stores everything on the filesystem.</p>

<p><a href="FileStore.html">FileStore</a> implements the <a
href="Strategy/LocalCache.html">Strategy::LocalCache</a> strategy which
implements an in-memory cache inside of a block.</p>

    </div>
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>C</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FileStore.html#method-i-cleanup">cleanup</a>,
              </li>
            
              
              <li>
                <a href="FileStore.html#method-i-clear">clear</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>D</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FileStore.html#method-i-decrement">decrement</a>,
              </li>
            
              
              <li>
                <a href="FileStore.html#method-i-delete_entry">delete_entry</a>,
              </li>
            
              
              <li>
                <a href="FileStore.html#method-i-delete_matched">delete_matched</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>I</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FileStore.html#method-i-increment">increment</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>N</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FileStore.html#method-c-new">new</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>R</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FileStore.html#method-i-read_entry">read_entry</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>W</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="FileStore.html#method-i-write_entry">write_entry</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  



  

    

    

    
      <!-- Section constants -->
      <div class="sectiontitle">Constants</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class="attr-name">DIR_FORMATTER</td>
            <td>=</td>
            <td class="attr-value">&quot;%03X&quot;</td>
          </tr>
          
            <tr valign='top'>
              <td>&nbsp;</td>
              <td colspan="2" class="attr-desc"></td>
            </tr>
          
        
          <tr valign='top'>
            <td class="attr-name">FILENAME_MAX_SIZE</td>
            <td>=</td>
            <td class="attr-value">228</td>
          </tr>
          
            <tr valign='top'>
              <td>&nbsp;</td>
              <td colspan="2" class="attr-desc"></td>
            </tr>
          
        
          <tr valign='top'>
            <td class="attr-name">EXCLUDED_DIRS</td>
            <td>=</td>
            <td class="attr-value">['.', '..'].freeze</td>
          </tr>
          
            <tr valign='top'>
              <td>&nbsp;</td>
              <td colspan="2" class="attr-desc"></td>
            </tr>
          
        
      </table>
    


    
      <!-- Section attributes -->
      <div class="sectiontitle">Attributes</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class='attr-rw'>
              [R]
            </td>
            <td class='attr-name'>cache_path</td>
            <td class='attr-desc'></td>
          </tr>
        
      </table>
    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-new">
            
              <b>new</b>(cache_path, options = nil)
            
            <a href="FileStore.html#method-c-new" name="method-c-new" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/b8837066dcaa389c00aaf22565bb6988ded3932e/activesupport/lib/active_support/cache/file_store.rb#L19" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-new_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activesupport/lib/active_support/cache/file_store.rb, line 19</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span>(<span class="ruby-identifier">cache_path</span>, <span class="ruby-identifier">options</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-keyword">super</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-ivar">@cache_path</span> = <span class="ruby-identifier">cache_path</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-identifier">extend</span> <span class="ruby-constant">Strategy</span><span class="ruby-operator">::</span><span class="ruby-constant">LocalCache</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                  
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-cleanup">
            
              <b>cleanup</b>(options = nil)
            
            <a href="FileStore.html#method-i-cleanup" name="method-i-cleanup" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-cleanup_source')" id="l_method-i-cleanup_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/b8837066dcaa389c00aaf22565bb6988ded3932e/activesupport/lib/active_support/cache/file_store.rb#L30" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-cleanup_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activesupport/lib/active_support/cache/file_store.rb, line 30</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">cleanup</span>(<span class="ruby-identifier">options</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">options</span> = <span class="ruby-identifier">merged_options</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-identifier">each_key</span>(<span class="ruby-identifier">options</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">entry</span> = <span class="ruby-identifier">read_entry</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">options</span>)
    <span class="ruby-identifier">delete_entry</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">options</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">expired?</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-clear">
            
              <b>clear</b>(options = nil)
            
            <a href="FileStore.html#method-i-clear" name="method-i-clear" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-clear_source')" id="l_method-i-clear_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/b8837066dcaa389c00aaf22565bb6988ded3932e/activesupport/lib/active_support/cache/file_store.rb#L25" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-clear_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activesupport/lib/active_support/cache/file_store.rb, line 25</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">clear</span>(<span class="ruby-identifier">options</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">root_dirs</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">cache_path</span>).<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> (<span class="ruby-constant">EXCLUDED_DIRS</span> <span class="ruby-operator">+</span> [<span class="ruby-string">&quot;.gitkeep&quot;</span>]).<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">f</span>)}
  <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_r</span>(<span class="ruby-identifier">root_dirs</span>.<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">cache_path</span>, <span class="ruby-identifier">f</span>)})
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-decrement">
            
              <b>decrement</b>(name, amount = 1, options = nil)
            
            <a href="FileStore.html#method-i-decrement" name="method-i-decrement" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-decrement_source')" id="l_method-i-decrement_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/b8837066dcaa389c00aaf22565bb6988ded3932e/activesupport/lib/active_support/cache/file_store.rb#L52" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-decrement_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activesupport/lib/active_support/cache/file_store.rb, line 52</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">decrement</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">amount</span> = <span class="ruby-number">1</span>, <span class="ruby-identifier">options</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">file_name</span> = <span class="ruby-identifier">key_file_path</span>(<span class="ruby-identifier">namespaced_key</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>))
  <span class="ruby-identifier">lock_file</span>(<span class="ruby-identifier">file_name</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">options</span> = <span class="ruby-identifier">merged_options</span>(<span class="ruby-identifier">options</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">num</span> = <span class="ruby-identifier">read</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>)
      <span class="ruby-identifier">num</span> = <span class="ruby-identifier">num</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">amount</span>
      <span class="ruby-identifier">write</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">num</span>, <span class="ruby-identifier">options</span>)
      <span class="ruby-identifier">num</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-delete_matched">
            
              <b>delete_matched</b>(matcher, options = nil)
            
            <a href="FileStore.html#method-i-delete_matched" name="method-i-delete_matched" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-delete_matched_source')" id="l_method-i-delete_matched_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/b8837066dcaa389c00aaf22565bb6988ded3932e/activesupport/lib/active_support/cache/file_store.rb#L66" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-delete_matched_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activesupport/lib/active_support/cache/file_store.rb, line 66</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">delete_matched</span>(<span class="ruby-identifier">matcher</span>, <span class="ruby-identifier">options</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">options</span> = <span class="ruby-identifier">merged_options</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-identifier">instrument</span>(<span class="ruby-value">:delete_matched</span>, <span class="ruby-identifier">matcher</span>.<span class="ruby-identifier">inspect</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">matcher</span> = <span class="ruby-identifier">key_matcher</span>(<span class="ruby-identifier">matcher</span>, <span class="ruby-identifier">options</span>)
    <span class="ruby-identifier">search_dir</span>(<span class="ruby-identifier">cache_path</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">key</span> = <span class="ruby-identifier">file_path_key</span>(<span class="ruby-identifier">path</span>)
      <span class="ruby-identifier">delete_entry</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">options</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">matcher</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-increment">
            
              <b>increment</b>(name, amount = 1, options = nil)
            
            <a href="FileStore.html#method-i-increment" name="method-i-increment" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-increment_source')" id="l_method-i-increment_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/b8837066dcaa389c00aaf22565bb6988ded3932e/activesupport/lib/active_support/cache/file_store.rb#L38" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-increment_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activesupport/lib/active_support/cache/file_store.rb, line 38</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">increment</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">amount</span> = <span class="ruby-number">1</span>, <span class="ruby-identifier">options</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">file_name</span> = <span class="ruby-identifier">key_file_path</span>(<span class="ruby-identifier">namespaced_key</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>))
  <span class="ruby-identifier">lock_file</span>(<span class="ruby-identifier">file_name</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">options</span> = <span class="ruby-identifier">merged_options</span>(<span class="ruby-identifier">options</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">num</span> = <span class="ruby-identifier">read</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>)
      <span class="ruby-identifier">num</span> = <span class="ruby-identifier">num</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">amount</span>
      <span class="ruby-identifier">write</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">num</span>, <span class="ruby-identifier">options</span>)
      <span class="ruby-identifier">num</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
              
      <div class="sectiontitle">Instance Protected methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-delete_entry">
            
              <b>delete_entry</b>(key, options)
            
            <a href="FileStore.html#method-i-delete_entry" name="method-i-delete_entry" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-delete_entry_source')" id="l_method-i-delete_entry_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/b8837066dcaa389c00aaf22565bb6988ded3932e/activesupport/lib/active_support/cache/file_store.rb#L96" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-delete_entry_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activesupport/lib/active_support/cache/file_store.rb, line 96</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">delete_entry</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">options</span>)
  <span class="ruby-identifier">file_name</span> = <span class="ruby-identifier">key_file_path</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">file_name</span>)
    <span class="ruby-keyword">begin</span>
      <span class="ruby-constant">File</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">file_name</span>)
      <span class="ruby-identifier">delete_empty_directories</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">file_name</span>))
      <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
      <span class="ruby-comment"># Just in case the error was caused by another process deleting the file first.</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">file_name</span>)
      <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-read_entry">
            
              <b>read_entry</b>(key, options)
            
            <a href="FileStore.html#method-i-read_entry" name="method-i-read_entry" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-read_entry_source')" id="l_method-i-read_entry_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/b8837066dcaa389c00aaf22565bb6988ded3932e/activesupport/lib/active_support/cache/file_store.rb#L79" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-read_entry_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activesupport/lib/active_support/cache/file_store.rb, line 79</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">read_entry</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">options</span>)
  <span class="ruby-identifier">file_name</span> = <span class="ruby-identifier">key_file_path</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">file_name</span>)
    <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file_name</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">f</span>) }
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;FileStoreError (#{e}): #{e.message}&quot;</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">logger</span>
  <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-write_entry">
            
              <b>write_entry</b>(key, entry, options)
            
            <a href="FileStore.html#method-i-write_entry" name="method-i-write_entry" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-write_entry_source')" id="l_method-i-write_entry_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/b8837066dcaa389c00aaf22565bb6988ded3932e/activesupport/lib/active_support/cache/file_store.rb#L89" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-write_entry_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activesupport/lib/active_support/cache/file_store.rb, line 89</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">write_entry</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">entry</span>, <span class="ruby-identifier">options</span>)
  <span class="ruby-identifier">file_name</span> = <span class="ruby-identifier">key_file_path</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">ensure_cache_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">file_name</span>))
  <span class="ruby-constant">File</span>.<span class="ruby-identifier">atomic_write</span>(<span class="ruby-identifier">file_name</span>, <span class="ruby-identifier">cache_path</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">entry</span>, <span class="ruby-identifier">f</span>)}
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    